home *** CD-ROM | disk | FTP | other *** search
- UNIT GPLib;
-
- INTERFACE
-
- USES
- Globals;
-
- PROCEDURE RSerBuf (outref : integer);
- PROCEDURE GoToXY (x, y : integer);
- PROCEDURE Place_checkmarks (menuId, firstItem, lastItem, chosenItem : Integer);
- PROCEDURE NewWindows;
- PROCEDURE SelectNewWindow;
-
- IMPLEMENTATION
-
- { reset the I/O variables and buffers }
-
- PROCEDURE RSerBuf; {(outref : integer);}
- BEGIN
- IF outrefnum <> outref THEN { reset port I/O variables and buffers }
- BEGIN
- IF outrefNumA = outref THEN {set to the 'A' buffers and variables }
- BEGIN
- outrefNum := outrefNumA;
- inrefNum := inrefNumB;
- inBuffPtr := inBuffPtrB;
- filterBuffPtr := filterBuffPtrB;
- RowA := Row;
- row := RowB;
- ColumnA := Column;
- Column := ColumnB;
- SetPort(WindowB);
- theWindow := WindowB;
- END
- ELSE
- BEGIN {set to the 'B' buffers and variables }
- outrefNum := outrefNumB;
- inrefNum := inrefNumA;
- inBuffPtr := inBuffPtrA;
- filterBuffPtr := filterBuffPtrA;
- RowB := Row;
- row := RowA;
- ColumnB := Column;
- Column := ColumnA;
- SetPort(WindowA);
- theWindow := WindowA;
- END;
- END;
- END;
-
- { set the position for the next character to be displayed }
-
- PROCEDURE GoToXY;
- VAR
- I, J : integer;
- BEGIN
- I := x * 6;
- J := y * 12 - 2;
- moveto(I, J);
- END;
-
- PROCEDURE Place_checkmarks; {(menuId, firstItem, lastItem, chosenItem : Integer)}
- VAR
- index : Integer;
-
- BEGIN
- FOR index := firstItem TO lastItem DO
- checkItem(myMenus[menuID], index, False);
- CheckItem(myMenus[menuID], chosenItem, True);
- END; {Place_checkmarks}
-
-
- { open a new window and set it's characteristics }
-
- PROCEDURE NewWindows;
-
- BEGIN
- numWindows := numWindows + 1;
- IF numWindows = 1 THEN { modem port A }
- theWindow := GetNewWindow(254, NIL, Pointer(-1));
- IF numWindows = 2 THEN { printer port B }
- theWindow := GetNewWindow(255, NIL, Pointer(-1));
- setPort(theWindow);
- TextFont(monaco);
- TextSize(9);
- ShowWindow(theWindow);
- Row := 1;
- Column := 1;
- END;
-
- { select the window selected by the user }
-
- PROCEDURE SelectNewWindow;
-
- BEGIN
- SelectWindow(whichWindow);
- theWindow := whichWindow;
-
- IF theWindow = windowA THEN
- BEGIN
- portA := true;
- RSerBuf(outrefnumA); { reset the I/O buffers and variables }
- END
- ELSE
- BEGIN
- portA := false;
- RSerBuf(outrefnumB); { reset the I/O buffers and variables }
- END;
- END;
-
- END.